import React, { Component,PropTypes} from 'react';
import {Link} from 'react-router';
import Modal from '../../Component/CommonComponent/Modal'
import OrderUnit from '../CommonComponent/OrderUnit'
import TabBar from '../../Component/CommonComponent/TabBar'
import Top from '../CommonComponent/Top'
import Empty from '../CommonComponent/Empty'
import {LeaderDeliveryOrderList,ConfirmCancel,Delivery} from '../../Action/auth';

export default class ExchangeOrder extends Component {
    static contextTypes = {
        router:PropTypes.object
    }

    // 构造PurchaseOrder
    constructor(props) {
        super(props);
        // 初始状态
        this.state = {
            index:0,
            orderPendItems:[],
            cancelModal:false,
            orderNo:'',
        };
    }

    async componentWillMount(){
        //await this.getPendOrderList(0,1);
    }

  /*  delivery(orderNo,detail){
        for(var i=0;i<detail.length;i++){
            if(detail[i].STOCK<detail[i].NUM){
                alert('库存不足，请前往进货');
                this.context.router.push({pathname:'purchase'});
                return
            }
        }
        if(confirm("确定发货?")){
            Delivery(orderNo)
                .then(res=>{
                    console.log(res);
                    alert('发货成功');
                    this.list=[];
                    this.page=1;
                    this.getPendOrderList(0,1)
                    this.myScroll.refresh();
                })
                .catch(err=>{
                    alert('库存不足，请前往进货')
                    this.context.router.push({pathname:'purchase'});
                    console.warn('发货失败',err)
                })
        }else{
            return;
        }

    }*/

    render(){
        const {orderPendItems,cancelModal} = this.state
        return(
            <div>
                <Top
                    title = {'换货订单详情'}
                />


                <div className="paddinglr  border_bottom" style={{marginTop:50,marginBottom:50}}>
                    <div className="flex flex-pack-justify flex-align-center border_bottom f14" style={{height:50}}>
                        <span className="color6">订单号： el.order_no</span>
                    </div>
                    {/*<Link to="/orderDetails" query={{orderNo:el.order_no}}>*/}
                    <div className="flex flex-pack-justify flex-align-center border_bottom f14" style={{height:50}}>
                        <span className="color6">退货</span>
                    </div>
                    <div className="padd10 flex flex-pack-justify f14" style={{borderBottom:'1px solid #e5e5e5',marginTop:10}}>
                        <div><img src="" style={{width:50,height:50}} alt=""/></div>
                        <div className=" flex-v" style={{marginLeft:20}}>
                            <div>库存：<span>10</span></div>
                            <div>退货：<span>10</span></div>
                        </div>
                    </div>
                    <div className="flex flex-pack-justify flex-align-center border_bottom f14" style={{height:50}}>
                        <span className="color6">换货</span>
                    </div>
                    <div className="padd10 flex flex-pack-justify f14" style={{borderBottom:'1px solid #e5e5e5',marginTop:10}}>
                        <div><img src="" style={{width:50,height:50}} alt=""/></div>
                        <div className=" flex-v" style={{marginLeft:20}}>
                            <div>库存：<span>10</span></div>
                            <div>换货：<span>10</span></div>
                        </div>
                    </div>

                </div>
                <div className="pf bottomCount flex flex-align-center flex-pack-center plr width100 colorfff f18"
                     style={{bottom:0,background:'rgba(250, 107, 91,.8)'}}>
                    发货
                </div>
            </div>
        )
    }

}